
#include "adapter_C_CPP.h"

#include "Timer.h"
#include "motor.h"
#include "LEDTube.h"

//--Global variables----------------------------------------------------------
//TIMER
timer g_timer;
//MOTOR
motor g_motor;
//LEDTube

//----------------------------------------------------------------------------
void g_timer_set_elapse(xuint16 elapse) {
  g_timer.set_elapse(elapse);
}

void g_timer_start(void) {
  g_timer.start();
}
void g_timer_refresh(void) {
  g_timer.refresh();
}
xuint8 g_timer_base(xuint16 b) {
  return g_timer.base(b);
}

//----------------------------------------------------------------------------

//----------------------------------------------------------------------------

void g_motor_set_status_L(motor_status status) 
{
  //DDRA = (DDRA&0b11101111)|0b00010000;
  //PORTA_BIT4 = 0;
  g_motor.set_status_L(status);  
}

void g_motor_set_status_R(motor_status status) 
{
  //DDRA = (DDRA&0b11101111)|0b00010000;
  //PORTA_BIT4 = 0;
  g_motor.set_status_R(status);  
}


void g_motor_set_speed_L(xuint8 speed)
{
  g_motor.set_speed_L(speed);
}

void g_motor_set_speed_R(xuint8 speed)
{
  g_motor.set_speed_R(speed);
}


motor_status g_motor_get_status_L(void) {
  return g_motor.get_status_L();
}

motor_status g_motor_get_status_R(void) {
  return g_motor.get_status_R();
}

xuint8 g_motor_get_speed_L() {
  return g_motor.get_speed_L();
}

xuint8 g_motor_get_speed_R() {
  return g_motor.get_speed_R();
}


  
  
  
  
  
  
  
  
  
  
  
  
  
